﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Imaging;
using System.Threading;
using System.Windows.Media.Imaging;
using AForge.Imaging;
using AForge.Imaging.Filters;
using BrainTechLLC;
using BrainTechLLC.ThreadSafeObjects;
using BrainTechLLC.ImageOperatorsNonAForgeDependent;
using System.Windows.Media;

namespace BrainTechLLC.ImageOperators
{
    public static partial class CreateThumbnails
    {        
        public static Bitmap CreateThumbnail(this Bitmap img, int oldWidth, int oldHeight, int thumbWidth, int thumbHeight, RenderSettings settings)
        {
            if (oldWidth == thumbWidth && oldHeight == thumbHeight )
                // Untested path
                return img.Clone() as Bitmap;
            else
                return img.CreateBitmap(oldWidth, oldHeight, thumbWidth, thumbHeight, true, settings);                
        }        
    }
}
